/*
 * Copyright 2002-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.gylang.springmini.lifecycle;


import com.gylang.springmini.exception.BeansException;
import com.gylang.springmini.factory.ConfigurableListableBeanFactory;

/**
 * 工厂钩子，允许自定义修改应用程序上下文的 bean 定义，调整上下文底层 bean 工厂的 bean 属性值。
 * 对于面向系统管理员的自定义配置文件很有用，这些文件覆盖了应用程序上下文中配置的 bean 属性。
 *
 * @author gylang
 * data 2021/11/12
 */
@FunctionalInterface
public interface BeanFactoryPostProcessor {

    /**
     * 在标准初始化之后修改应用程序上下文的内部 bean 工厂。 所有 bean 定义都将被加载，
     * 但尚未实例化任何 bean。 这甚至允许覆盖或添加属性，甚至是急切初始化的 bean
     *
     * @param beanFactory the bean factory used by the application context
     * @throws BeansException
     */
    void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException;

}
